﻿<UserControl x:Class="Wallace.IDE.SalesForce.UI.ManifestEditorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid PreviewKeyDown="control_PreviewKeyDown">
        <Grid.RowDefinitions>
            <RowDefinition Height="75" MinHeight="75" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <DockPanel Grid.Row="0"
                   LastChildFill="True">
            <TextBlock Foreground="Black"
                       FontWeight="Bold"
                       Margin="0,5,5,5"
                       DockPanel.Dock="Top"
                       Text="Comment:" />
            
            <ScrollViewer VerticalScrollBarVisibility="Auto"
                          HorizontalScrollBarVisibility="Hidden">
                <TextBox x:Name="textBoxComment"
                         AcceptsReturn="True"
                         AcceptsTab="True"
                         Margin="0,0,0,3"                         
                         Foreground="Green"
                         FontFamily="Consolas"
                         FontSize="10pt"
                         BorderThickness="0"
                         TextWrapping="Wrap"
                         TextChanged="textBoxComment_TextChanged" />
            </ScrollViewer>
        </DockPanel>
        
        <GridSplitter Grid.Row="0" 
                      Height="3"
                      Background="Gray"
                      VerticalAlignment="Bottom"
                      HorizontalAlignment="Stretch"/>
        
        <Border Grid.Row="1"
                Margin="0,5,0,5"
                BorderThickness="0,0,0,3"
                BorderBrush="Gray">
            <TextBlock Margin="0,0,0,5"
                       Foreground="Black"
                       FontWeight="Bold"
                       Text="Drag and drop source files to the space below to add them to this manifest:" />
        </Border>

        <ListView x:Name="listViewItems"
                  Grid.Row="2" 
                  BorderThickness="0"
                  Padding="3"
                  AllowDrop="True"
                  DragOver="listViewItems_DragOver"
                  Drop="listViewItems_Drop"
                  KeyDown="listViewItems_KeyDown">
            
            <ListView.Resources>
                <Style TargetType="{x:Type GridViewColumnHeader}">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Style>
            </ListView.Resources>
            
            <ListView.View>
                <GridView>
                    <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="Auto" />
                </GridView>
            </ListView.View>

            <ListView.GroupStyle>
                <GroupStyle>
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock FontWeight="Bold" FontSize="14" Text="{Binding Name}"/>
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                </GroupStyle>
            </ListView.GroupStyle>

        </ListView>
    </Grid>
</UserControl>
